﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Documents.web.Models.PatientListModel>" %>
<div id="PatientListController">
<ul id="PatientListSelector" class="tabs">
    <li listid="InPatients">
        In Patients
    </li>
    <li listid="Discharges">
        Discharges
    </li>
    <li listid="Admissions">
        Admissions
    </li>
</ul>
<div id="InPatientsList" class="patientlistitem">
<%  Html.RenderPartial("PatientListPartial", Model.InPatients); %>
</div>
<div id="DischargesList"class="patientlistitem">
<% Html.RenderPartial("PatientListPartial", Model.Discharges); %>
</div>    
<div id="AdmissionsList" class="patientlistitem">
<% Html.RenderPartial("PatientListPartial", Model.Discharges); %>
</div>  
</div>
<script type="text/javascript">
    $("#PatientListSelector li").click(function() {
        var selector = $(this).attr("listid");
        $("#PatientListController div.patientlistitem").addClass("hidden");
        if (selector == "InPatients")
            $("#InPatientsList").removeClass("hidden");
        else if (selector == "Discharges")
            $("#DischargesList").removeClass("hidden");
        else if (selector == "Admissions")
            $("#AdmissionsList").removeClass("hidden");
        $("#PatientListSelector li.selected").removeClass("selected");
        $(this).addClass("selected");
    });
</script>